package org.gradle.sample;

import java.io.InputStream;
import org.apache.commons.io.IOUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class Greeter {

	private static Logger logger = LoggerFactory.getLogger(Greeter.class);

	public String getGreeting() throws Exception {
		logger.info("generating greeting.");
		InputStream greetingStr = getClass().getResourceAsStream(
				"/greeting.txt");
		try {
			return IOUtils.toString(greetingStr).trim();
		} finally {
			greetingStr.close();
		}
	}
}
